package com.myz.service.feign.config;

import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.context.annotation.Import;

/**
 * 因为@FeignClient的value不能重复，所以需要在这里以自定义的方式来创建
 * <p>
 * http://www.flydean.com/spring-cloud-openfeign-demo/
 *
 * @author maoyz
 */
// @Data
// @Configuration
@Import(FeignClientsConfiguration.class)
public class MultipleSameNameFeignClientsConfiguration {

    // private ScheduleService scheduleService;
    //
    // private ScheduleUploadService scheduleUploadService;
    //
    // private static final String URL = "http://SERVICE-MEMBER";
    //
    // @Autowired
    // public MultipleSameNameFeignClientsConfiguration(Decoder decoder, Client client, Contract contract) {
    //     this.scheduleService = Feign.builder().client(client)
    //             .decoder(decoder)
    //             .contract(contract)
    //             // 默认是Logger.NoOpLogger
    //             .logger(new Slf4jLogger(ScheduleService.class))
    //             // 默认是Logger.Level.NONE
    //             .logLevel(Logger.Level.FULL)
    //             .target(ScheduleService.class, URL);
    //
    //     this.scheduleUploadService = Feign.builder().client(client)
    //             .decoder(decoder)
    //             .contract(contract)
    //             //默认是Logger.NoOpLogger
    //             .logger(new Slf4jLogger(ScheduleUploadService.class))
    //             //默认是Logger.Level.NONE
    //             .logLevel(Logger.Level.FULL)
    //             .target(ScheduleUploadService.class, URL);
    // }

}
